Electronic apparatuses, in which a flash memory, such as a solid state drive (SSD) or an embedded multi-media card (MMC) is mounted as a main storage device, have increased in number. Meanwhile, as a semiconductor manufacturing process rule has been subdivided in recent years, the maximum number of data writing times or data retention period of a flash memory has tended to decrease, and an interest in reliability and durability of flash memories is increasing. The data retention period of a flash memory is shortened as the number of times of writing data into the flash memory increases. For this reason, in order to ensure the reliability, it is extremely important to hold down the number of times of writing data into a flash memory.
As a method of reducing the number of times of writing data into a flash memory, in general, there has been used a method of reducing the number of data writing times by preparing a cache area inside a storage device, such as a random access memory (RAM) which has high-speed data access and by buffering data of substantial size into the cache area and then writing the data into the flash memory. However, when a power switch of a device employing the method has been turned off and a power supply to the device has been stopped before the process of writing the data into the flash memory, such a situation can damage the data stored in the RAM, which can make a problem that data which is desired to be continuously used when the device is operated next time is lost.
Regarding this problem, Japanese Patent Application Laid-Open Publication (JP-A) No. 2001-036978 discloses the following state information collector. The state information collector includes an electric lead to be connected to an electric circuit of a target apparatus; a section for converting an electric potential of the electric lead into digital data; a memory section and a second memory section for accumulating and storing the digital data; a section for repeatedly sampling the digital data to accumulate the digital data in the memory section; a section for detecting a surrounding environment; and a section for accumulating and writing the accumulated data of the memory section into the second memory section when a certain object in the environment, which is detected by the section for detecting the surrounding environment, shows a specific change.
The technology in the above-described JP-A No. 2001-036978 performs processing of writing data into an external nonvolatile storage device (MO disk) when the section for detecting the surrounding environment (human body proximity sensor) detects a change (absence/presence of human) in the surrounding environment. In the technology, the processing of writing data is performed even when a user approaches close to the apparatus without any intention to turn off the power switch. For this reason, if the technology is employed to the process of writing data into a flash memory, the number of data writing times increases and life expectancy of the flash memory is shortened. The present invention seeks to solve those problems.